r = 1 gotpen = 1 gothotcoffee = 1 teacher = 1 buck = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 12) AS STRING directions(1) = "EAST" directions(2) = "NORTH, EAST, OR WEST" directions(3) = "NORTH OR SOUTH" directions(4) = "NORTH OR SOUTH" directions(5) = "EAST, WEST, OR SOUTH" directions(6) = "EAST" directions(7) = "EAST OR WEST" directions(8) = "WEST OR SOUTH" directions(9) = "NORTH OR SOUTH" directions(10) = "NORTH OR SOUTH" directions(11) = "NORTH OR WEST" directions(12) = "EAST OR WEST" PRINT "" PRINT "" PRINT "You are sitting at a desk in the middle of class when the teacher leaves for" PRINT "a moment. Then as all the other students begin to leave one by one and you" PRINT "are left sitting here like a chump. Well, time for you to make a break for it." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " School Adventure " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 IF r = 10 THEN: GOSUB r10 IF r = 11 THEN: GOSUB r11 IF r = 12 THEN: GOSUB r12 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotpen = 1 THEN: PRINT "Pen" IF gothotcoffee = 1 THEN: PRINT "Hot Coffee" PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 11 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 9: GOTO moved IF r = 9 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 6 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 8: GOTO moved IF r = 1 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 12: GOTO moved IF r = 12 THEN: r = 11: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 2: GOTO moved IF r = 8 THEN: r = 9: GOTO moved IF r = 9 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 11: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 8 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 11 THEN: r = 12: GOTO moved IF r = 12 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 1: GOTO moved END IF IF (cmd$ = "TALK TO BUCK") AND r = 10 THEN CLS PRINT "What do you want, punk?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO TEACHER") AND r = 5 THEN CLS PRINT "Hey, punk, shouldn't you be in class?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE BUCK") AND r = 10 THEN CLS PRINT "He's an average height punk, wearing a jean vest without the arms," PRINT "and a torn pair of pants. He seems as if he hasn't bathed in weeks." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE HOT COFFEE") AND gothotcoffee = 1 THEN CLS PRINT "A freshly brewed cup of coffee, the aroma brings a tear to your eye." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE PEN") AND gotpen = 1 THEN CLS PRINT "A standard blue ball point pen." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE PEN") AND gotpen = 1 AND r = 10 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE HOT COFFEE") AND gothotcoffee = 1 AND r = 5 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standiung at your desk, wondering just where the hell" PRINT "everyone went? A strong smell of bleach fills the air." RETURN r2: PRINT "Standing in the large hallway. Everyone is gone, not a soul in sight," PRINT "just silence." RETURN r3: PRINT "Every step you take in the abandoned hallway adds on the fear. Your" PRINT "footsteps echo through the confines of the hall. You think it maybe" PRINT "taco Tuesday?" RETURN r4: PRINT "The hammering sound of the clock hanging on the wall, ticking away." PRINT "Though the hands don't seem to be moving at all." RETURN r5: PRINT "Standing before like a drunk old homeless man, is Mr. Walter. He looks" PRINT "completely out of it. Probably just a late night." RETURN r6: PRINT "An exit, a way out of this school, and it will allow you to head" PRINT "home. But alas it's locked." RETURN r7: PRINT "Is it lunch? Has someone called in a bomb threat again? This is too" PRINT "quiet for school." RETURN r8: PRINT "The usual wall of posters trying to tell kids to not smoke or to" PRINT "drink are covering the walls. But alas they have no effect." RETURN r9: PRINT "In the distance you see a large slab of human flesh. Blocking half" PRINT "the hallway...great." RETURN r10: PRINT "The large twenty year old student, who failed more times than he" PRINT "can remember himself, stands before you. Going by the name of Buck." RETURN r11: PRINT "You see a closed classroom, with the sign nailed to it reading" PRINT "-No Hot Drinks in Hallway.-" RETURN r12: PRINT "You are standing in an empty hallway. Not a sound can be heard nor a" PRINT "whisper muttered." RETURN win: COLOR 2, 0 CLS PRINT "You throw the hot coffee on the teacher's crotch. He falls" PRINT "to his knee's and cries in pain. With him down on the ground" PRINT "you make your way out and head for home. Where your video" PRINT "games await for you...sigh." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "Before you can think it over, you plunge the pen into Buck's" PRINT "leg. He let's out a cry in pain and falls to the ground." PRINT "Everyone runs out to see that Buck has been stabbed and you" PRINT "sir are kicked out of school...punk." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "You wait around in class until the teacher comes in and is shocked" PRINT "to see you still waiting for class. You are told to leave and you" PRINT "hear under the teachers -Punk kid.- So you go home...a loser..." _DISPLAY END END SUB